<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
    <th:block th:include="include :: header('单位资质资源列表')" />
</head>

<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>资源名称：</label>
                                <input type="text" name="sourceName" />
                            </li>
                            <li>
                                <label>资源简称：</label>
                                <input type="text" name="sourceShortName" />
                            </li>
                            <li>
                                <label>资源编码：</label>
                                <input type="text" name="sourceCode" />
                            </li>
                            <li>
                                <label>资源类型：</label>
                                <select name="sourceType" th:with="type=${@dict.getType('')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>资源介绍：</label>
                                <input type="text" name="sourceIntroduce" />
                            </li>
                            <li class="select-time">
                                <label>上传日期：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                    name="params[beginUploadDate]" />
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                    name="params[endUploadDate]" />
                            </li>
                            <li>
                                <label>上传人员：</label>
                                <input type="text" name="uploadPerson" />
                            </li>
                            <li class="select-time">
                                <label>维护日期：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                    name="params[beginMaintainDate]" />
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                    name="params[endMaintainDate]" />
                            </li>
                            <li>
                                <label>维护人员：</label>
                                <input type="text" name="maintainPerson" />
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()">
                    <!-- shiro:hasPermission="ruoyi-business:business:add" -->
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()">
                    <!-- shiro:hasPermission="ruoyi-business:business:edit" -->
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
                    <!-- shiro:hasPermission="ruoyi-business:business:remove" -->
                    <i class="fa fa-remove"></i> 删除
                </a>
                <!--<a class="btn btn-warning" onclick="$.table.exportExcel()">
                    &lt;!&ndash; shiro:hasPermission="ruoyi-business:business:export" &ndash;&gt;
                    <i class="fa fa-download"></i> 导出
                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        // var editFlag = [[${@permission.hasPermi('ruoyi-business:business:edit')}]];
        var editFlag = "";
        // var removeFlag = [[${@permission.hasPermi('ruoyi-business:business:remove')}]];
        var removeFlag = "";
        var uploadFlag = "";
        var prefix = ctx + "business/dw"; // ajax请求前缀
        var page_prefix = ctx + "business/page/dw"; // 页面访问前缀
        var uploadTitle = "上传"
        var uploadUrl = page_prefix + "/upload"
        $(function () {
            var options = {
                url: prefix + "/list",
                createUrl: page_prefix + "/dwadd",
                updateUrl: page_prefix + "/dwedit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "单位资质资源",
                sortOrder: "desc",
                columns: [{
                        checkbox: true
                    },
                    {
                        field: 'id',
                        title: '主键',
                        visible: false
                    },
                    {
                        field: 'sourceName',
                        title: '资源名称'
                    },
                    {
                        field: 'sourceShortName',
                        title: '资源简称'
                    },
                    {
                        field: 'sourceCode',
                        title: '资源编码'
                    },
                    {
                        field: 'sourceType',
                        title: '资源类型'
                    },
                    {
                        field: 'sourceIntroduce',
                        title: '资源介绍'
                    },
                    {
                        field: 'uploadDate',
                        title: '上传日期'
                    },
                    {
                        field: 'uploadPerson',
                        title: '上传人员'
                    },
                    {
                        field: 'maintainDate',
                        title: '维护日期'
                    },
                    {
                        field: 'maintainPerson',
                        title: '维护人员'
                    },
                    {
                        field: 'sourceTip',
                        title: '资源备注'
                    },
                    {
                        title: '操作',
                        align: 'center',
                        width: "15%",
                        formatter: function (value, row, index) {
                            var actions = [];
                            uploadUrl = page_prefix + "/upload";
                            // var id = "?id=" + row.id;
                            // console.log("id",id)
                            // var type = "&type=" + row.sourceType;
                            uploadUrl = uploadUrl+"?zyid=" + row.id+"&type=dw"
                            /*actions.push('<a class="btn btn-success btn-xs ' + editFlag +
                                '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row
                                .id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag +
                                '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row
                                .id + '\')"><i class="fa fa-remove"></i>删除</a> ');*/
                            actions.push('<a class="btn btn-warning btn-xs ' + uploadFlag +
                                '" href="javascript:void(0)" onclick="$.modal.open(uploadTitle,uploadUrl,800,600)"><i class="fa fa-upload"></i>上传</a> ');
                            actions.push('<a class="btn btn-primary btn-xs ' + uploadFlag +
                                '" href="javascript:void(0)" onclick="$.modal.op n(uploadTitle,uploadUrl)"><i class="fa fa-search"></i>预览</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag +
                                '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row
                                    .id + '\')"><i class="fa fa-download"></i>下载</a> ');
                            return actions.join('');
                        }
                    }
                ]
            };

            $.table.init(options);
        });
    </script>
</body>
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
        </div>
    </form>
    </script>

</html>